const app = getApp();
const baseURL = app.globalData.baseURL;
Page({
  data: {
    num: 0
  },
  moneyInput(e) {
    this.data.num = e.detail.value;
  },
  doRecharge() {
    wx.request({
      url: `${baseURL}/user/user/recharge`,
      method: 'POST',
      data: this.data.num,
      header: {
        "Authorization": 'Bearer ' + wx.getStorageSync('token')
      },
      success: (res) => {
        if (res.data.code == 200) {
          wx.navigateBack({delta:1})
          wx.showToast({
            title: '充值成功',
          })
        }
      }
    })
  }
})